home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / libdmalloc / stacktrace_s.s < prev    next >
Encoding:
Text File  |  1994-08-02  |  1.1 KB  |  60 lines

  1. #include <sys/regdef.h>
  2. #include <sys/asm.h>
  3.  
  4. /*
  5.     void *_stacktrace_get_pc();
  6. */
  7. LEAF(_stacktrace_get_pc)
  8.     move    v0,ra    /* our ra is pc of the caller, I hope */
  9.     j        ra
  10. END(_stacktrace_get_pc)
  11.  
  12.  
  13. /*
  14.     void *_stacktrace_get_sp();
  15. */
  16. LEAF(_stacktrace_get_sp)
  17.     move    v0,sp    /* this is a leaf so sp doesn't change, I hope */
  18.     j        ra
  19. END(_stacktrace_get_sp)
  20.  
  21.  
  22. /*
  23.     void _stacktrace_get_regs(void *regs[32]);
  24. */
  25. LEAF(_stacktrace_get_regs)
  26.     sw    $31,    31*4(a0)  /* XXX not right, but this app doesn't care */
  27.     sw    $30,    30*4(a0)
  28.     sw    $29,    29*4(a0)
  29.     sw    $28,    28*4(a0)
  30.     sw    $27,    27*4(a0)
  31.     sw    $26,    26*4(a0)
  32.     sw    $25,    25*4(a0)
  33.     sw    $24,    24*4(a0)
  34.     sw    $23,    23*4(a0)
  35.     sw    $22,    22*4(a0)
  36.     sw    $21,    21*4(a0)
  37.     sw    $20,    20*4(a0)
  38.     sw    $19,    19*4(a0)
  39.     sw    $18,    18*4(a0)
  40.     sw    $17,    17*4(a0)
  41.     sw    $16,    16*4(a0)
  42.     sw    $15,    15*4(a0)
  43.     sw    $14,    14*4(a0)
  44.     sw    $13,    13*4(a0)
  45.     sw    $12,    12*4(a0)
  46.     sw    $11,    11*4(a0)
  47.     sw    $10,    10*4(a0)
  48.     sw    $9,    9*4(a0)
  49.     sw    $8,    8*4(a0)
  50.     sw    $7,    7*4(a0)
  51.     sw    $6,    6*4(a0)
  52.     sw    $5,    5*4(a0)
  53.     sw    $4,    4*4(a0)
  54.     sw    $3,    3*4(a0)
  55.     sw    $2,    2*4(a0)
  56.     /* sw    $1,    1*4(a0) */
  57.     sw    $0,    0*4(a0)
  58.     j    ra
  59. END(_stacktrace_get_regs)
  60.